// components/popup/popup.js
Component({
    options: {
        addGlobalClass: true
    },
    /**
     * 组件的属性列表
     */
    properties: {
        title: String,
        cancel: Boolean,
        spaceTapCancel: Boolean,
    },

    /**
     * 组件的初始数据
     */
    data: {
        bottom: 0
    },

    ready(){
        wx.onKeyboardHeightChange(res=>{
            console.log(res)
            this.setData({
                bottom: res.height / 2
            })
        })
    },

    /**
     * 组件的方法列表
     */
    methods: {
        
        close() {
            this.triggerEvent('cancel')
        },
        blankClose() {
            if (this.data.spaceTapCancel)
                this.triggerEvent('cancel')
        },
        catchtap(){
            return false
        }
    }
})
